package day11;
import java.io.*;
public class learn5 {
    public static void main(String[] args) throws IOException {
        //创建文件
        File file=new File("D:\\WUDownloadCache\\abc.jpg");
        file.createNewFile();
        File file1=new File("E:\\abc.jpg");
        file1.createNewFile();
        //写入文件
        FileOutputStream fileOutputStream=new FileOutputStream(file);
        //取出这个文件
        FileInputStream fileInputStream=new FileInputStream(file1);
        int temp;
        try{
            while((temp=fileInputStream.read())!=-1){
                fileOutputStream.write(temp);
            }
        }catch ( Exception e){
            e.printStackTrace();
        }finally {
            fileInputStream.close();
            fileOutputStream.close();
        }

    }
}
